/*************************************************************************
	> File Name: MySum.java
	> Author: blackwall
	> Mail: wangzq@besti.edu.cn
	> Created Time: 2019年09月20日 星期五 10时18分07秒
 ************************************************************************/
import java.util.Scanner;
public class MySum{
    public static void main(String []agrs) {
        double num1,num2,num3;
        int num4;
        Scanner scan = new Scanner(System.in);
        
        System.out.println("Pls input one number:");
        num1 = scan.nextDouble();
        
        System.out.println("Pls input another number:");
        num2 = scan.nextDouble();
        
        System.out.println("Pls input third number:");
        num3 = scan.nextDouble();

        System.out.println("Pls input a integer :");
        num4 = scan.nextInt();
        
        System.out.println("The sum of first two number is :" + sum(num1,num2));
        System.out.println("The sum of three number is :" + sum(num1, num2, num3));
        System.out.println("The sum of a double number and a integer is :" + sum(num4, num1));
        System.out.println("The sum of a double number and a integer is :" + sum(num1, num4));
    }
    public static double sum(double num1, double num2){
        return num1 + num2;
    }

    public static double sum(double num1, double num2, double num3){
        return num1 + num2 + num3;
    }

    public static double sum(double num1, int num2){
        System.out.println("The result is the sum of a double number and an integer.");
        return num1 + num2;
    }
    
    public static double sum(int num1, double num2){
        System.out.println("The result is the sum of an integer and a double number.");
        return num1 + num2;
    }    
}

